<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   template="/WEB-INF/templates/default.xhtml">
   <ui:define name="content">
      <h1>Welcome to JBoss!</h1>

      <div>
         <p>You have successfully deployed a Java EE 6 web application.</p>
         <h3>Your application can run on:</h3>
         <img src="resources/gfx/dualbrand_as7eap.png"/>
      </div>

      <h:form id="reg">
         <h2>Tipo Documento Registration</h2>
         <p>Ingreso de un nuevo Tipo de Documento</p>
         <h:panelGrid columns="3" columnClasses="titleCell">
            <h:outputLabel for="name" value="Name:"/>
            <h:inputText id="name" value="#{newTipoDocumento.descripcion}" />
            <h:message for="name" errorClass="invalid"/>
         </h:panelGrid>

         <p>
            <h:panelGrid columns="2">
               <h:commandButton id="register" action="#{tipoDocumentoController.register}" value="Register" styleClass="register"/>
               <h:messages styleClass="messages" errorClass="invalid" infoClass="valid" warnClass="warning"
                           globalOnly="true"/>
            </h:panelGrid>
         </p>
      </h:form>
      <h2>Tipos Documentos</h2>
      <h:panelGroup rendered="#{empty tipoDocumentos}">
         <em>No registered Documentos</em>
      </h:panelGroup>
      <h:dataTable var="_tipo" value="#{tipoDocumentos}" rendered="#{not empty tipoDocumentos}" styleClass="simpletablestyle">
         <h:column>
            <f:facet name="header">Id</f:facet>
                #{_tipo.idTipoDocumento}
            </h:column>
         <h:column>
            <f:facet name="header">Name</f:facet>
                #{_tipo.descripcion}
            </h:column>
         
      </h:dataTable>
   </ui:define>
</ui:composition>
